package picobot.tests.students;

import junit.framework.TestCase;
import picobot.interfaces.core.IPicobot;
import picobot.interfaces.core.IRule;
import picobot.tests.Bootstrap;

public class PublicTestPicobot extends TestCase {

  /** Creates a simple picobot and tests the result of toString() */
  public void testA() {
    IPicobot p = Bootstrap.f().createPicobot();
    String s = p.toString();
    System.out.println(s);
    assertEquals( s, 
         "Picobot at position [0, 0] in state 0 with 0 rules.");
  }
  
  /** Applies a given rule.
   *  (This test does not require a map.)
   */
  public void testB() {
    IPicobot p = Bootstrap.f().createPicobot();
    IRule r = Bootstrap.f().createRuleBuilder().parseRule("0 N*** -> S 0");
    // moving to north
    p.apply(r);
    System.out.println(p.toString());
    assertEquals( p.toString(), 
         "Picobot at position [0, -1] in state 0 with 0 rules.");    
  }
}
